package leetcode.code0030;

import java.util.List;

import leetcode.IDebug;
import leetcode.helper.HelpDebug;

public abstract class Solution30 implements IDebug {

	public abstract List<Integer> findSubstring(String s, String[] words);

	@Override
	public void debug1() {
		String s = "barfoothefoobarman";
		String str1 = "[\"foo\",\"bar\"]";
		List<Integer> r = this.findSubstring(s, HelpDebug.str2array2(str1));
		String str2 = "[0,9]";
		List<Integer> e = HelpDebug.str2intlist(str2);
		HelpDebug.compare(e, r);
	}

	@Override
	public void debug2() {
		String s = "wordgoodgoodgoodbestword";
		String str1 = "[\"word\",\"good\",\"best\",\"word\"]";
		List<Integer> r = this.findSubstring(s, HelpDebug.str2array2(str1));
		String str2 = "[]";
		List<Integer> e = HelpDebug.str2intlist(str2);
		HelpDebug.compare(e, r);
	}

	@Override
	public void debug3() {
		String s = "barfoofoobarthefoobarman";
		String str1 = "[\"bar\",\"foo\",\"the\"]";
		List<Integer> r = this.findSubstring(s, HelpDebug.str2array2(str1));
		String str2 = "[6,9,12]";
		List<Integer> e = HelpDebug.str2intlist(str2);
		HelpDebug.compare(e, r);
	}

	@Override
	public void debug4() {
		String s = "a";
		String str1 = "[\"a\"]";
		List<Integer> r = this.findSubstring(s, HelpDebug.str2array2(str1));
		String str2 = "[0]";
		List<Integer> e = HelpDebug.str2intlist(str2);
		HelpDebug.compare(e, r);
	}
	public void debug5() {
		String s = "aaa";
		String str1 = "[\"a\",\"a\"]";
		List<Integer> r = this.findSubstring(s, HelpDebug.str2array2(str1));
		String str2 = "[]";
		List<Integer> e = HelpDebug.str2intlist(str2);
		HelpDebug.compare(e, r);
	}

}
